package resume

import (
	"crypto/sha1"
	"encoding/hex"
	"golang.org/x/exp/rand"
	"strconv"
	"time"
)

func To_filename(filename string) string {
	rand.Seed(uint64(time.Now().UnixNano()))
	randomString := strconv.Itoa(rand.Intn(1000000)) // 生成一个随机的6位数字符串
	hash := sha1.New()
	hash.Write([]byte(randomString))
	hashValue := hex.EncodeToString(hash.Sum(nil))
	return filename + "&amp&" + hashValue[len(hashValue)-7:] // 截取最后7位数
}
